home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 4829 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  8.1 KB

  1. Path: informatik.tu-muenchen.de!fischerj
  2. From: fischerj@informatik.tu-muenchen.de (Juergen "Rally" Fischer)
  3. Newsgroups: comp.sys.amiga.programmer,comp.sys.amiga.advocacy,comp.os.ms-windows.advocacy
  4. Subject: Re: intuition inefficient ?
  5. Date: 5 Mar 1996 15:49:02 GMT
  6. Organization: Technische Universitaet Muenchen, Germany
  7. Distribution: world
  8. Message-ID: <4hhnpe$6tn@sunsystem5.informatik.tu-muenchen.de>
  9. References: <4gm2qg$8lk@sunsystem5.informatik.tu-muenchen.de> <4grs7r$plr@harbinger.cc.monash.edu.au> <4gtq1c$mu0@sunsystem5.informatik.tu-muenchen.de> <4h9i69$fi6@harbinger.cc.monash.edu.au>
  10. NNTP-Posting-Host: hphalle6g.informatik.tu-muenchen.de
  11. Originator: fischerj@hphalle6g.informatik.tu-muenchen.de
  12.  
  13.  
  14. In article <4h9i69$fi6@harbinger.cc.monash.edu.au>, bmeyer@bruce.cs.monash.edu.au (Bernd Meyer) writes:
  15. |> Organization: Computer Science, Monash University, Australia
  16. |> Lines: 97
  17. |> Distribution: world
  18. |> Message-ID: <4h9i69$fi6@harbinger.cc.monash.edu.au>
  19. |> References: <4gm2qg$8lk@sunsystem5.informatik.tu-muenchen.de> <4grs7r$plr@harbinger.cc.monash.edu.au> <4gtq1c$mu0@sunsystem5.informatik.tu-muenchen.de>
  20. |> NNTP-Posting-Host: molly.cs.monash.edu.au
  21. |> X-NNTP-Posting-User: bmeyer
  22. |> X-Newsreader: TIN [UNIX 1.3 950823BETA PL0]
  23. |> Xref: informatik.tu-muenchen.de comp.sys.amiga.programmer:88317 comp.sys.amiga.advocacy:152975 comp.os.ms-windows.advocacy:134701
  24. |> 
  25. |> Juergen "Rally" Fischer (fischerj@Informatik.TU-Muenchen.DE) wrote:
  26. |> : Bernd Meyer (bmeyer@bruce.cs.monash.edu.au) wrote:
  27. |> : : Juergen "Rally" Fischer (fischerj@Informatik.TU-Muenchen.DE) wrote:
  28. |> : 
  29. |> : : what --- there is two standard ways to catch the vblank signal on a 
  30. |> : : VGA card, and one of them is using an interrupt.
  31. |> : 
  32. |> : Are you sure vblank interrupt is something "standard" on PC ?
  33. |> : I believe each newer VGA got the possibility to send such an
  34. |> : interrupt signal, but what about the _compatible_ way of using it ?
  35. |> 
  36. |> What is the compatible way of using an interrupt? Sorry, I can't really
  37.  
  38. compatible means "runs on all computer of a certain class" :->
  39. i.e. "runs on all PCs". 
  40. i.e. won't fail on any VGA card.
  41.  
  42. |> answer this question for you, Juergen. If you don't know how to use
  43. |> an interrupt, you probably shouldn't discuss things like this. And
  44.  
  45. don't talk about me, face my arguments ;) 
  46. I know how interrupts work, thanks.
  47.  
  48. And I guess you'll get some trouble on other OSes than MS-DOS
  49. when trying to set up a fake vbl-int.
  50.  
  51. |> BTW, it's not "newer" VGA cards --- it's been every VGA compatible card
  52. |> since the very first VGA card IBM delivered.
  53.  
  54. there are differences between VGAs, I do know. The one will flicker if
  55. you update scrollregs while vbl-bit active, the other one if you do this
  56. short after vbl bit active (reference: commercial game producing screwed
  57. up display why tring to softscroll on my friends VGA).
  58.  
  59. |> 
  60. |> : : register. This is due to the fact that almost everyone quickly disables
  61. |> : : the vblank interrupt as wasting valuable resources.
  62. |> : 
  63. |> : _polling_ is waste of respources!
  64. |> 
  65. |> No, using an IRQ line for something as trivial as the vblank signal is
  66. |> a waste of resources. 
  67.  
  68. Yes, seen from the user of a Workstation (i.e a computer you _WORK_ on)
  69. maybe, but the user of a Multimedia station wants fast clean animation,
  70. which needs a vblank _interrupt_. 
  71. My point of view is multimedia, i.e. max efficient use of cpu for animations.
  72.  
  73. |>  
  74. |> : so double buffering is waste of
  75. |> : recources. efficient rastersplit free animation needs tripple buffering,
  76. |> 
  77. |> No problem with that --- although you only need triple buffering if
  78. |> you can't guarantee that you get one screenful of data created in the
  79. |> time it takes to display one screen. If you could guarantee that, you'd
  80.  
  81. which is true for all mapping games, even on PC!
  82. Only turbo-consoles manage to map a scene in 1 frame maybe.
  83. This is not the problem I told about!
  84.  
  85. |> have no need for triple buffering.
  86.  
  87. for example doom is reported to magically not run above 35fps.
  88. reason: almost all current cpus are to slow to do animation in 
  89. 1 frame. if it's fast enough to render in 1.01 frames, you lose
  90. cpu time when using double buffering, because then cpu _busy waits_ 
  91. for the next vblank to occur (and drops to 2 frames in that example).
  92.  
  93. That's why they don't wait for vblank in descent any more.
  94. Result: max usage of cpu, _but_ rastersplit. this would not
  95. happen on a real multimedia platform. 
  96.  
  97. I do admit that PCs give most cheap cpu power now.
  98.  
  99. |>
  100. |> : which needs either an interrupt or a gfx-hardware that will use a
  101. |> : write to adress-registers not immedeately, but after next vblank.
  102. |> 
  103. |> *Grin* Well, Juergen, this sophisticated hardware you just described
  104. ;)
  105.  
  106. |> is _also_ in every single VGA card since the very first IBM has
  107. |> ever produced. At the start of every frame (at the vblank signal, so to
  108. |> say), the value of the "start of image memory" register is sampled into
  109. |> an internal latch. So you don't even have to get the timing of the
  110. |> register write right.....
  111.  
  112. that's nice. so if I had 2 buffers on a VGA in mode 13h, it would work.
  113.  
  114. the alternative, modex, seems to be too slow when acessed by cpu,
  115. or why do you think so much PC games either rastersplit or busywait ?
  116.  
  117. Tell me a way to do it (not only under DOS), and I will tell my
  118. friend who is about to implement POOG (gfx/game library) on PC.
  119.  
  120. |> 
  121. |> : : want an interrupt, you get one. How?
  122. |> : :[...]
  123. |> : : vblank signals. You can then set up one of those high precision timers
  124. |> : 
  125. |> : one of those ? :) The _one and only_ which is able to cause interrupts
  126. |> : in a normal PC.
  127. |> 
  128. |> There is two of them, actually.
  129.  
  130. on all PCs ? a 2nd timer interrupt ?
  131.  
  132. |> 
  133. |> : : Now was that really so hard? All of the functionality used in this 
  134. |> : 
  135. |> : No :) I knew, my friend told me. He also told that there are some
  136. |> : problems. Such as interrupts occuring for the time the vblank bit
  137. |> : is set. bzzzt, another frame cpu busy-wait. Won't occur on a DOS demo,
  138. |> : but on a tasking environment it will.
  139. |> 
  140. |> a) you could disable other interrupts for the time you wait. Very easy,
  141. |>    and if you programmed your timer well, they are only disabled for
  142. |>    a very short time
  143.  
  144. yesyes, you can do a lot of evil things on DOS, the "DEMO OPERATING SYSTEM" :)
  145. that's why DOS is for games. gotta shutddown your tasking-OS for playing
  146. a game though, not quite state-of-the-art in multimedia age...
  147.  
  148. |> 
  149. |> b) You could set a certain timeout, after which you assume you missed
  150. |>    the vblank and pretend it has been there, anyway. Be a bit more
  151. |>    wasteful when reprogramming the timer, because you don't know how far
  152. |>    down the image you are
  153. |> 
  154. |> c) But most importantly: I don't think the VGA vblank bit gets reset
  155. |>    by anything other than reading the register. Which would mean
  156. |>    there is no way of "missing" it. I'm not sure, though, and I don't
  157. |>    have a tech spec of the VGA standard handy at the moment.
  158.  
  159. It's all a DOS harddwarehack.
  160.  
  161. |> : 
  162. |> : : You probably know where my money is. Have a look at the SVGALIB for
  163. |> : Yes, Bill Gates got it ;)
  164. |> 
  165. |> If you still think that, Juergen, you are a lost case. I never paid
  166. |> a single cent, Pfennig, Oere, pecne or centime (and no other denomiations,m
  167. |> either) for an MS product. Never. Not once.
  168.  
  169. wow! :) even I paid some pence buying my 8bit computer (msx). _shudder_ :)
  170.  
  171. |> 
  172. |> : : : I can't believe they'll ever implement those nice little things A500 
  173. |> : : : already had (vblank & stuff) into PC hardware _and_ the OSes (win, linux).
  174. |> : 
  175. |> : : And I can't believe how narrow-minded you are, sorry.
  176. |> : 
  177. |> : You didn't read exactly, I didn't tell about vblank-polling.
  178. |> 
  179. |> And I explained two standard methods of getting vblank interrupts.
  180. under DOS, yes.
  181.  
  182. |> Now I really can't do any more than offering TWO methods, right?
  183.  
  184. wait a minute, you told me how to hack the timer under DOS.
  185. what's the 2nd fake-vblanbk-interrupt method ?
  186.  
  187. |> 
  188. |> : But as narrow-minded resource-wasting PCer you probably can't
  189. |> : think of anything more :)
  190. |> 
  191. |> I can. Can you?
  192.  
  193. hey, all my computers got a real vblank interrupt, even my small 8bit one!
  194.  
  195. |> 
  196. |> Bernie
  197. |> 
  198. ------------------------------------------------------------------------
  199.    fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer)   =:)
  200.